In modern computer design, resources provided in a computer system are shared among several processing devices for efficient performance. Each resource can comprise, e.g., a processor configured to perform preselected operations or processing services for the other processing devices of the system. Whenever a resource is provided in a computer system, fairness becomes a design issue. Fairness concerns the fair allocation of the services provided by the resource among the processing devices that utilize the resource. It is typically a design criteria in the implementation of a resource that no one processing device so dominate the use of the resource that other processing devices of the computer system are unable to receive adequate service from the resource.
In one scheme for interlocking processing devices to a shared resource, a plurality of storage devices, such as, e.g., ring buffers, is provided. Each processing device of the system that utilizes a particular resource is allocated one or more of the ring buffers. In this manner, each processing device can write into addressable locations within an allocated ring buffer, requests for use of the resource and other information that may be required by the resource for the performance of its service. The resource operates to poll the addressable locations of the ring buffers, as, e.g., in a round robin scheme, to read and process the requests and other information stored in the ring buffers.
Typically, an "ownership" scheme is implemented in the ring buffer system so that a processing device will write a request into an allocated ring buffer location only when the processing device "owns" that location. The processing device relinquishes ownership once it writes a request into a particular location. The resource returns the ownership to the processing device after it has read the information in the particular ring buffer location and proceeds to process the request. A processing device will not be able to write additional requests once it has relinquished ownership of all of its allocated locations until the resource returns ownership for at least one location.
The number of buffered requests represents the workload imposed by the processing devices on the resource. Thus, the fair allocation of the resource can be controlled by fixing the size and number of ring buffers allocated to each processing device that utilizes the shared resource on the basis of the expected use of the resource by each processing device. A processing device will be allocated a number of locations that will not result in an inordinate number of outstanding requests at any one time. Once the size of a ring buffer is fixed, the corresponding processing device must be made cognizant of that size and execute address software that generates addresses to properly identify the locations within the physical address space occupied by the allocated ring buffer.
If a processing device were coupled to several resources and the allocated ring buffers for the various resources were of different sizes, each ring buffer size must be communicated to the respective processing device and the processing device would have to execute different address software, each appropriate for the generation of addresses for the address space of one of the ring buffer sizes.
For example, a processing device would generate one of 256 possible addresses to verify ownership and thereafter write a request to a particular location within a 256 byte ring buffer. If the size of another ring buffer allocated to the processing device were 128 bytes, the corresponding processing device would then have to execute address software that recognizes a 128 location address space. Since a processing device may be allocated different sizes of ring buffers by different resources in a system, it has to 1) be cognizant of the size of the ring buffer allocated to it by the particular resource when it attempts to access its ring buffer for that resource and 2) when processing the ring buffer to a given resource, take into account the size of the ring buffer so as to execute address software that generates addresses to properly identify the locations within the physical address space occupied by the allocated ring buffer.